home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1988 January & February
/
rerun-1988-01-02.d64
/
calendar maker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
83 lines
10 rem calendar maker
20 rem by: bob kodadek
30 rem 3164 surrey lane
40 rem aston, pa 19014
50 :
60 dim mo$(12),nd(12),mm(50),xm$(50,5):u$=chr$(221)
70 for i=1to12:read mo$(i),nd(i):next
80 for i=0to6:read d$:dy$=dy$+d$+" ":pd$=pd$+d$+" ":next
90 for i=0to9:s$=s$+" ":next:for i=0to77:h$=h$+chr$(45):next
100 us$=u$+s$:print"[147]run - calendar maker":print:gosub 590
110 gosub 690
120 gosub 330:k=val(a$):if k<1 or k>5 then 120
130 if k=4 then print"[147]one moment...":run
140 if k=5 then end
150 on k gosub 180,380,430:goto110
160 :
170 rem ----- edit memos -----
180 gosub 300
190 print"[147]memos for "mo$(mo)dt
200 print" >----------< 10 characters each":gosub 270
210 print"[145][145][145][145][145][145][145]":for i=0to5:input"";x$:x$=left$(x$,10)
220 if len(x$) <10 then x$=x$+chr$(32):goto 220
230 xm$(dt+j,i)=x$:next:print
240 gosub 270:print"is this correct? (y or n)"
250 gosub 330:if a$ <> "y" then 190
260 return
270 for i=0to5:if xm$(dt+j,i)="" then xm$(dt+j,i)=s$
280 print i+1 spc(1) chr$(18) xm$(dt+j,i):next:return
290 :
300 print"enter memo date 1 -"nd(mo):input dt
310 if dt <1 or dt >nd(mo) then print"[145][145][145]":goto 300
320 mm(dt)=1:return
330 :
340 a$="":get a$:if a$="" then 330
350 return
360 :
370 rem ------ cancel memo ------
380 gosub 300:mm(dt)=0:for i=0to5
390 xm$(dt+j,i)=s$:next
400 return
410 :
420 rem ------ print calendar ------
430 print"[147] turn on printer":print"ready? (y or n)"
440 gosub 330:if a$ <> "y" then return
450 close 4:open 4,4:c=0:c1=1:n=0
460 l=len(mo$(mo))/2:print#4,chr$(14) spc(16-l) mo$(mo)" -" yr
470 print#4,chr$(13) chr$(13) chr$(14)left$(pd$,39):print#4,chr$(15):print#4,h$
480 for i=1toy:for t=0to6:c=c+1
490 if c=<j or n=>nd(mo) then print#4,us$;:goto 520
500 n=n+1:n$=" "+mid$(str$(n),2)
510 print#4,left$(us$,7)chr$(14)right$(n$,2)chr$(15);
520 next t:print#4,u$
530 for t1=0to5:for t2=0to6
540 if xm$(c1+t2,t1)=""then print#4,us$;:goto560
550 print#4,u$+xm$(c1+t2,t1);
560 next t2:print#4,u$:next t1:c1=c1+7:print#4,h$
570 next i:print#4:close 4:return
580 :
590 rem ------ gregorian date ------
600 input"enter month (1-12)";mo:if mo <1 or mo>12 then print"[145][145]":goto600
610 input"enter year (yyyy)";yr:if yr <1583 then print"[145][145]":goto610
620 q=yr+(mo<3):j=int(275*mo/9)-int((7*q+7)/4)+367*yr+1-int((int(q/100)+1)*3/4)
630 j=j-4-7*int((j-4)/7):x=(nd(mo)+j)/7:y=int(x):if x>y then y=y+1
640 if(yr/100)-int(yr/100)=0 and (yr/400)-int(yr/400)<>0 then return
650 if (yr/4)-int(yr/4)=0 and mo=2 then nd(mo)=29
660 return
670 :
680 rem ----- print screen -----
690 l=len(mo$(mo))/2:print"[147]"spc(16-l) mo$(mo)" -" yr
700 print:print spc(3) dy$:print:c=0:n=0
710 for i=1toy:for t=1to7:c=c+1:if c=<j then print spc(5):goto 750
720 if n=>nd(mo) then 750
730 n=n+1:n$=" "+mid$(str$(n),2):if mm(n) then print chr$(18);
740 print spc(3) right$(n$,2) chr$(146);
750 next t:print:print:next i
760 print"1. edit a memo":print"2. cancel memo":print"3. print calendar"
770 print"4. new calendar":print"5. quit"
780 print"select (1-5)":return
790 :
800 data january,31,february,28,march,31,april,30,may,31,june,30,july,31
810 data august,31,september,30,october,31,november,30,december,31
820 data sun,mon,tue,wed,thu,fri,sat